#pragma once
#include <cv.h>
#include <highgui.h>
#include <cvaux.h>
#include <fstream>
#include <vector>
#include <map>
#include "stdafx.h"
#include "CapturingAndStoring.h"

class LearningAndRecognition
{
public:
	LearningAndRecognition(void);
	~LearningAndRecognition(void);
	void LearnAndRecognizeFace(char * argv[]);
	void CreateTrainingTextFileWithFilePaths(std::vector<std::string> &vectorFilePaths);
	void CreateRecognitionTextFileWithFilePaths(std::vector<std::string> &vectorFilePaths);
	void learn(char * argv[]);
	void doPCA();
	void storeTrainingData(char * argv[]);
	int loadFaceImgArray(const char * filename);

private:
	std::wstring s2ws(const std::string &s);
	void CreateTrainingSetAndStoreOnDisk(char * argv[], std::string input, std::vector<std::string> &vectorFilePaths, std::vector<std::string> &vectorPersonNames, int &personCounter);
	void ReadTrainingTextFile(std::map<int, std::string> &mapPersonNumName);
	bool fexists(const char * filename);
};

